package com.woniu.controller.homepage;

import com.woniu.service.homePage.ISearchHistoryService;
import com.woniu.util.ResData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 凌雨
 * @data 2023/3/9 14:55
 */
@RestController
@RequestMapping("/app/search")
public class SearchHistoryController {

    @Autowired
    private ISearchHistoryService searchHistoryService;

    /**
     * 查询搜索历史
     * @param phone 用户手机号
     * @return
     */
    @RequestMapping("/searchHistory")
    public ResData<?> querySearchHistory(String phone){
        return searchHistoryService.querySearchHistory(phone);
    }

    /**
     * 删除搜索历史
     * @param phone 用户的手机号
     * @return
     */
    @RequestMapping("/deleteSearch")
    public ResData<?> deleteSearchHistory(String phone){
        return searchHistoryService.deleteSearchHistory(phone);
    }

}
